Skip to content

Drop the logger < 1.6 dependency pin#45

Open
tas50 wants to merge 1 commit into
chef:mainfrom
tas50:cleanup/remove-logger-pin
Open

Drop the logger < 1.6 dependency pin#45
tas50 wants to merge 1 commit into
chef:mainfrom
tas50:cleanup/remove-logger-pin

Conversation

@tas50

@tas50 tas50 commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Removes the s.add_dependency "logger", "< 1.6" pin (and its stale "remedy before Ruby 3.3" comment).

Background

The pin was added in July 2024 to avoid logger 1.6.0, which introduced thread-local log levels by adding state in Logger#initialize. That broke Logger subclasses (across the ecosystem — Rails/ActiveSupport, and Chef's Mixlib::Log::Logger) that overrode initialize without calling super. Expressed as < 1.6, the pin also blocks all of 1.6.x and 1.7.x.

Two reasons it's safe to drop now:

  1. ChefSpec doesn't use logger directly — there is no require "logger" anywhere in lib/. It only arrives transitively through chef, which owns that compatibility concern.
  2. The modern Chef stack handles current logger fine. Verified locally against Chef 19.2.12 / Mixlib::Log 3.2.3 with logger 1.7.0 forced: require "chefspec" succeeds, Chef::Log instantiates and logs, and the full unit suite passes 162 examples, 0 failures.

Testing

  • Gem::Specification.load("chefspec.gemspec").validate → valid.
  • Unit suite under logger 1.7.0 (local lib): 162 examples, 0 failures.
  • cookstyle --chefstyle -c .rubocop.yml chefspec.gemspec → no offenses.

Note

Touches chefspec.gemspec, as do #31 (removes the dangling rspec-expectations comment) and #40 (adds the metadata block). All three edit different lines and should merge cleanly.

The pin was added in July 2024 to dodge logger 1.6.0, which made log
levels thread-local by adding state in Logger#initialize and broke
Logger subclasses that did not call super. ChefSpec does not require
logger anywhere in lib/ — it only arrives transitively via chef — and
the modern Chef stack handles current logger correctly.

Verified against Chef 19.2.12 / Mixlib::Log 3.2.3 with logger 1.7.0:
chefspec loads, Chef::Log works, and the unit suite is green. Remove the
pin (and its stale "remedy before Ruby 3.3" comment) so the gem stops
holding back logger for its consumers.

Signed-off-by: Tim Smith <tsmith84@proton.me>
@tas50
tas50 requested review from a team and jaymzh as code owners June 28, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant